package com.glsc.ngateway.common.base.domain.mysql.gateway.other;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author liwei
 * 文件中心，第三方传输的数据
 */
@Data
@Entity
@Table(name = "t_file_center_tran_data")
@org.hibernate.annotations.Table(appliesTo = "t_file_center_tran_data", comment = "文件中心，第三方传输的数据")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FileCenterTranData implements Serializable {

    private static final long serialVersionUID = -8143682777578640457L;


    @ApiModelProperty(value = "主键：类型+数据方id")
    @Id
    @Column(name = "id", columnDefinition = "varchar(80) COMMENT '主键：类型+数据方id'")
    private String id;

    @ApiModelProperty(value = "数据类型")
    @Column(name = "data_type", columnDefinition = "varchar(10) COMMENT '数据类型：ysp衍生品'")
    private String dataType;

    @ApiModelProperty(value = "第三方数据系统id")
    @Column(name = "third_system_id", columnDefinition = "varchar(80) COMMENT '第三方数据系统id'")
    private String thirdSystemId;

    @ApiModelProperty(value = "客户类型")
    @Column(name = "client_type", columnDefinition = "varchar(10) COMMENT '客户类型'")
    private String clientType;

    @ApiModelProperty(value = "第三方系统数据")
    @Column(name = "third_system_data", columnDefinition = "varchar(255) COMMENT '第三方系统数据'")
    private String thirdSystemData;

    @ApiModelProperty(value = "备注")
    @Column(name = "memo", columnDefinition = "varchar(255) COMMENT '备注'")
    private String memo;

    @ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time", columnDefinition = "datetime comment '创建时间'", updatable = false)
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @Column(name = "op_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime opTime;

    @Column(name = "der_party_name", columnDefinition = "varchar(128) comment '交易对手方名称'")
    private String partyName;

    @Column(name = "der_party_organ_code", columnDefinition = "varchar(64) comment '交易对手方组织机构代码'")
    private String partyOrganCode;


}
